<template>
  <div
    class="leftNavBar_container"
    :class="{ open_leftNavBar: is_switch }"
  >
    <van-icon
      name="cross"
      size="0.35rem"
      class="btn_show"
      @click="switch_leftNavBar"
    />
    <div class="gn">
      <div class="about_gn flex-top-left">
        <van-icon name="info" class="icon_style"/>
        <p @click="go_about">关于</p>
      </div>
    </div>
    <div class="overlay"></div>
  </div>
</template>

<script>
export default {
  name: "LeftNavBar",
  data() {
    return {
      is_switch: false,
    };
  },
  methods: {
    //打开侧边导航
    switch_leftNavBar() {
      this.is_switch = !this.is_switch;
    },
    go_about() {
      this.$router.push('/about')
      // alert('敬请期待')
    }
  },
};
</script>

<style scoped>
.leftNavBar_container {
  position: fixed;
  top: 0;
  left: 0;
  width: 1.5rem;
  height: 100%;
  z-index: 999;
  /*  */
  transform: translateX(-2rem);
  transition: all 0.35s ease;
  background-color: #fff;
}
.btn_show {
  position: absolute;
  right: 0rem;
  top: 0.1rem;
}
.gn {
  margin-top: 0.5rem;
  width: 100%;
  height: auto;
  padding: 0.35rem 0.25rem;
  box-sizing: border-box;
  font-size: 0.2rem;
  text-align: center;
  line-height: 0;
}
/* 打开侧边栏 */
.open_leftNavBar {
  transform: translateX(0rem);
  transition: all 0.5s ease;
}
.icon_style {
  margin-right: 0.1rem;
}
</style>